package com.rwdesign.springboot.Waimai.dao;

import com.rwdesign.springboot.Waimai.entity.Goods;
import com.rwdesign.springboot.Waimai.entity.Shop;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsMapper {

    List<String> selectAllGoodsTypes(Integer shopId);

    /**
     * @return
     * @Author chendanping
     * @Description //TODO 查询所有商品
     * @Date 21:45 2022/3/2
     * @Param
     **/
    List<Goods> selectAllGoods(@Param("goodsType") String goodsType, @Param("shopId") Integer shopId);

    /**
     * @Author chendanping
     * @Description //TODO 通过goodsId查询商品
     * @Date 11:20 2022/3/6
     * @Param
     * @return
     **/
    Goods selectGoodsById(Integer goodsId);

    /**
     * 新增商品
     * @param goods
     * @return
     */
    Integer addGoods(Goods goods);

    /**
     * @Author chendanping
     * @Description //TODO 删除商品通过id
     * @Date 11:20 2022/3/6
     * @Param
     * @return
     **/
    Integer deleteGoodsById(Integer goodsId);

    /**
     * 编辑商品
     * @param goods
     * @return
     */
    Integer updataGoods(Goods goods);


    /**
     * @Author chendanping
     * @Description //TODO 查询商品所属的shopId
     * @Date 20:41 2022/3/8
     * @Param
     * @return
     **/
    Integer selectShopIdByGoodsId(Integer goodsId);


    int deleteByPrimaryKey(Integer goodsId);

    int insert(Goods record);

    int insertSelective(Goods record);

    Goods selectByPrimaryKey(Integer goodsId);

    int updateByPrimaryKeySelective(Goods record);

    int updateByPrimaryKey(Goods record);
}